<?php
    $date = time();
    $date = date('N',$date);
    switch($date)
    {
        case "1":
        {
            $data = Province::getDataByMon();
            //var_dump($data);
            break;
        }
        case "2":
        {
            $data = Province::getDataByTue();
            //var_dump($data);
            break;
        }
        case "3":
        {
            $data = Province::getDataByWed();
            //var_dump($data);
            break;
        }
        case "4":
        {
            $data = Province::getDataByThu();
            //var_dump($data);
            break;
        }
        case "5":
        {
            $data = Province::getDataByFri();
            //var_dump($data);
            break;
        }
        case "6":
        {
            $data = Province::getDataBySat();
            //var_dump($data);
            break;
        }
        case "7":
        {
            $data = Province::getDataBySun();
            //var_dump($data);
            break;
        }
    }
?>

<div class="Title">
    Kết quả xổ số hôm nay
</div>
<div class="KQXSToday">
    <ul>
        <li>
            <a href="<?php echo Yii::app()->createUrl('home/index');?>"><img src="<?php echo Yii::app()->params['static_url'];?>images/xo-so-10h-icon_List.gif" class="img_KQXSToday" /><h2>Xổ số 
                    <?php
                        foreach($data as $tinh)
                        {
                            //var_dump($tinh['code']);
                            if($tinh['region'] == 1 && $tinh['name'] != "Miền Bắc")
                            {
                                echo $tinh['name'];
                            }
                        }
                    ?>
                </h2>
            </a>
        </li>
        <li>
            <a href="<?php echo Yii::app()->createUrl('home/dientoan');?>"><img src="<?php echo Yii::app()->params['static_url'];?>images/xo-so-10h-icon_List.gif" class="img_KQXSToday" /><h2>Xổ số Điện toán 123</h2></a>
        </li>
        <li>
            <a href="<?php echo Yii::app()->createUrl('home/dientoan');?>"><img src="<?php echo Yii::app()->params['static_url'];?>images/xo-so-10h-icon_List.gif" class="img_KQXSToday" /><h2>Xổ số Điện toán 6x36</h2></a>
        </li>
        <li>
            <a href="<?php echo Yii::app()->createUrl('home/dientoan');?>"><img src="<?php echo Yii::app()->params['static_url'];?>images/xo-so-10h-icon_List.gif" class="img_KQXSToday" /><h2>Xổ số Thần tài</h2></a>
        </li>
    </ul>    
</div>
<div class="line"></div>
<div class="KQXSToday">
    <ul>

        <?php foreach($data as $tinh){
            if($tinh['region'] == 3)
            {
            ?>
            <li>
                <a href="<?php echo Yii::app()->createUrl('home/miennam');?>"><img src="<?php echo Yii::app()->params['static_url'];?>images/xo-so-10h-icon_List.gif" class="img_KQXSToday" /><h2>Xổ số 
                        <?php

                            echo $tinh['name'];

                        ?>
                    </h2>
                </a>
            </li>
            <?php }}?>
    </ul>    
</div>
<div class="line"></div>
<div class="KQXSToday">
    <ul>
        <?php foreach($data as $tinh){
            if($tinh['region'] == 2)
            {
            ?>
            <li>
                <a href="<?php echo Yii::app()->createUrl('home/mientrung');?>"><img src="<?php echo Yii::app()->params['static_url'];?>images/xo-so-10h-icon_List.gif" class="img_KQXSToday" /><h2>Xổ số 
                        <?php

                            echo $tinh['name'];

                        ?>
                    </h2>
                </a>
            </li>
            <?php }}?>
    </ul>    
        </div>
